﻿

<CascadingAuthenticationState>
    <Router AppAssembly="@typeof(App).Assembly"
            AdditionalAssemblies="new[]{typeof(Beetle.Modules.BtAdminUI.Shared._Imports).Assembly, typeof(Beetle.Modules.BtAdminUI.Wasm._Imports).Assembly, typeof(Beetle.Demo.SharedUI._Imports).Assembly}">
        <Found Context="routeData">
            <AuthorizeRouteView RouteData="@routeData"
                                DefaultLayout="@typeof(PageLayout)">
                <Authorizing>authorizing...</Authorizing>
                <NotAuthorized>
                    <RedirectToLogin />
                    @*  @context.ToJson()
                    @if (!(context.User?.Identity?.IsAuthenticated??false))
                    {
                        <RedirectToLogin />
                    }
                    else
                    {
                        <p>
                            You are not authorized to access
                            this resource.
                        </p>
                    } *@
                    <p>
                        You are not authorized to access
                        this resource.
                    </p>
                </NotAuthorized>
            </AuthorizeRouteView>
            <AppSignalRComponent></AppSignalRComponent>
        </Found>
        <NotFound>
            <LayoutView Layout="@typeof(PageLayout)">
                <p>Sorry, there's nothing at this address.</p>
            </LayoutView>
        </NotFound>
    </Router>
</CascadingAuthenticationState>